package com.eduadmin.service;

import com.eduadmin.entity.Statistics;
import com.eduadmin.entity.StatisticsFinished;
import com.eduadmin.mapper.StatisticsFinishedMapper;
import com.eduadmin.mapper.StatisticsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class StatisticsFinishedServiceImpl implements IStatisticsFinishedService {
    private final StatisticsFinishedMapper statisticsFinishedMapper;

    @Autowired
    public StatisticsFinishedServiceImpl(StatisticsFinishedMapper statisticsFinishedMapper) {
        this.statisticsFinishedMapper = statisticsFinishedMapper;
    }

    @Override
    public List<StatisticsFinished> getAllStatisticsFinished(Integer offset,Integer rows) {
        return statisticsFinishedMapper.getAllStatisticsFinished(offset,rows);
    }
    public List<StatisticsFinished> getAllStatisticsFinishedByParams(Map<String,Object> paraMap){
        return statisticsFinishedMapper.getAllStatisticsFinishedByParams(paraMap);
    }
    // 返回记录的条数
    public int isHaveStatistics(Map<String,Object> paraMap) {
        return statisticsFinishedMapper.isHaveStatistics(paraMap);
    }
    public int insert(StatisticsFinished record) {
        statisticsFinishedMapper.insert(record);
        return 1;
    }
    // 根据条件（统计表名称，学期，年级，考试，分类）删除已经完成了统计的记录。
    public int deleteByParams(Map<String,Object> paraMap){
        statisticsFinishedMapper.deleteByParams(paraMap);
        return 1;
    }
    public int deleteByPrimaryKey(Integer statisticsFinishedId) {
        statisticsFinishedMapper.deleteByPrimaryKey(statisticsFinishedId);
        return 1;
    }
    public int getAllStatisticsFinishedNumber(){ return statisticsFinishedMapper.getAllStatisticsFinishedNumber();}
}
